package org.example.lease.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.example.lease.mapper.FacilityInfoMapper;
import org.example.lease.model.entities.FacilityInfo;
import org.example.lease.model.enums.ItemType;
import org.example.lease.service.FacilityInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;


/**
 * @author 宋孟林
 * @description
 * @date: 2025/5/12 16:52
 */
@Service
@Slf4j
public class FacilityInfoServiceImpl extends ServiceImpl<FacilityInfoMapper, FacilityInfo>
        implements FacilityInfoService {
    @Resource
    private FacilityInfoMapper facilityInfoMapper;

    @Override
    public List<FacilityInfo> listFacility(ItemType itemType) {
        List<FacilityInfo> facilityInfos = facilityInfoMapper.selectList(Wrappers.lambdaQuery(FacilityInfo.class).eq(itemType != null,
                FacilityInfo::getType, itemType));
        return facilityInfos;
    }
}




